<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="ot" uri="http://www.ideyatech.com/tides"%>
<%@ taglib prefix="idy" tagdir="/WEB-INF/tags"%>

<idy:bs-iris-header title_webpage="title.admin.medicalProgram">
</idy:bs-iris-header>

<div class="page-body">
	<div class="admin-search-box">
		<div class="form-box-title"><h4><spring:message code="label.admin.medicalProgram.search"/></h4></div>
		<form:form id="medicalProgramSearchForm" commandName="medicalProgram" action="${url_context}/medicalPrograms.jspx" cssClass="form-horizontal">
			<div class="control-group">
				<form:label path="name" cssClass="control-label"><spring:message code="label.admin.medicalProgram.name" /> :</form:label>
				<div class="controls">
					<form:input path="name" maxlength="50"/>
				</div>
			</div>
			
			<div class="control-group">
				<div class="controls">
					<input type="submit" class="btn btn-primary" name="Submit_" value="<spring:message code="label.submit" />" />
               		<input type="button" class="btn" name="clear" value="Clear" id="search-clear"/>
				</div>
			</div>
			
			<ot:sort_input searchFormId="medicalProgramSearchForm"/>
		</form:form>
	</div>
	
	<div id="medicalProgram-row-new"></div>
	
	<div class="pull-right">
		<ot:paging results="${results}" baseURL="${url_context}/medicalPrograms.jspx" pageParamName="page" displaySummary="true" displayPageLinks="false" searchFormId="medicalProgramSearchForm"/>
	</div>
	<ot:add_button page="medicalPrograms.jspx" prefix="medicalProgram"/>
	
	<table class="table table-striped table-condensed table-bordered">
    	<thead>
        	<tr>
           		<th>
           			<ot:header_sort headerField="name" headerLabel="label.admin.medicalProgram.name" prefix="${medicalProgram}" searchFormId="medicalProgramSearchForm" />
           		</th>
           		<th><spring:message code="label.admin.medicalProgram.description" /></th>
           		<th><spring:message code="label.admin.medicalProgram.goal" /></th>
           		<th></th>
           	</tr>
		</thead>
		<tbody id="medicalProgram-table-results">
			<c:forEach items="${results.results}" var="record" varStatus="status">
	        	<tr id="medicalProgram-row-${record.id}">
	           		<td>
	           			<c:out value="${record.name}" />
	           		</td>
	           		<td>
	           			<c:out value="${record.description}" />
	           		</td>
	           		<td>
	           			<c:out value="${record.goal}" />
	           		</td>
	           		<td>
						<ot:update_button id="${record.id}" page="medicalPrograms.jspx" prefix="medicalProgram"/>
	                 	<ot:delete_button id="${record.id}" page="medicalPrograms.jspx" title="${record.name}" prefix="medicalProgram"/>                  		
	               	</td>	
	           	</tr>
			</c:forEach>
		</tbody>
	</table>
	<div style="text-align: center;">
    	<ot:paging results="${results}" baseURL="${url_context}/medicalPrograms.jspx" pageParamName="page" displaySummary="false" displayPageLinks="true" searchFormId="medicalProgramSearchForm"/>
    </div>
</div>


<idy:bs-iris-footer>
	<script type="text/javascript">
		$(document).ready(function(){
			$('#search-clear').click(function(){
				IRIS.htmlUtil.clearSearchPane('medicalProgramSearchForm');
			});
		});
	</script>
</idy:bs-iris-footer>